/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package inventory;
import java.sql.*;

/**
 *
 * @author Mark King
 */
public class dbConnector {
    private String url = "jdbc:mysql://localhost:3306/";
    private String dbtime;
    private String dbName = "inventorysystem";
    private String driver = "com.mysql.jdbc.Driver";
    private String userName = "root";
    private String password = "p@ssword";
    private Connection conn;
    
    public void connect()
    {
        try {
        Class.forName(driver).newInstance();
        conn = DriverManager.getConnection(url+dbName,userName,password);
        System.out.println("Connected to the database");
        }catch(Exception e){
            e.printStackTrace();
        }
    }
    
    
    public Connection getConnector()
    {
        return conn;
    }
    
    
}
